package org.gene.aop;

import org.aspectj.lang.JoinPoint;
import org.aspectj.lang.ProceedingJoinPoint;

/**
 * 
 * @author 长远
 * 一：注解的方式：
 * <aop:aspectj-autoproxy/>
 * @Component
	@Aspect
	声明在类前
	@Pointcut("execution(* org.genecheek.spring.service.*.*(..)))")
	public void pointcut(){}
	@Before("pointcut()")
	@After("pointcut()")
	@Around("pointcut()")
	@AfterThrowing(pointcut = "execution (* org.genecheek.spring.service.*.*(..))))",throwing = "ex")
 * 二：配置的方式：
 * <aop:config>    
        <aop:aspect id="aspect" ref="methodTimeAdvice">    
            <aop:pointcut id="logService"    
                expression="execution(* org.genecheek.spring.service.*.*(..))" />    
            <aop:before pointcut-ref="logService" method="doBefore"/>    
            <aop:after pointcut-ref="logService" method="doAfter"/>    
            <aop:around pointcut-ref="logService" method="doAround"/>    
        </aop:aspect>    
    </aop:config>
    <bean id="methodTimeAdvice" class="org.genecheek.aop.MethodTimeAdvice"></bean>
 */
public interface MethodAdvice {

	public void doBefore(JoinPoint jp);
	public void doAfter(JoinPoint jp);
	public Object doAround(ProceedingJoinPoint pjp)throws Throwable;
	public void afterThrowing(Exception ex);
}
